<?
	//get id, poll title in table poll_type
	$sql_poll_title = "SELECT * FROM `poll_type`";
	$sql = " SELECT COUNT( `poll_result` )FROM `poll` WHERE `poll_result` = ? ";
	$cmd1 = $mysqli -> prepare($sql_poll_title);
	$cmd1 ->execute() or die($mysqli ->error);
	$cmd1 ->store_result();
	$cmd1 ->bind_result($id,$poll_title);
?>
<div id="box_thamdoykien">
	<div id="sub_box_thamdoykien">
		<div class="bg_tt_right"><div class="bg_tt_left"><div class="bg_tt">
		  <div class="text_tt">K&#7870;T QU&#7842; TH&#258;M D&Ograve; &Yacute; KI&#7870;N </div>
		</div></div></div>
		<div id="sub_box_thamdoykien1">
			<div class="ct_right"><div class="ct_left"></div>
				<div class="ct">

					<div id="container">	
						<div id="poll-container">
							<div class="text">&Yacute; ki&#7871;n v&#7873; ch&#432;&#417;ng tr&igrave;nh &#273;&#7841;o t&#7841;o c&#7911;a h&#7885;c vi&ecirc;n
							</div>
							<div style="width: 50%;float:left">
								<ul>								
									<?
                                                                            echo"<li>";
										//get poll_result in poll
										//start while
										while($cmd1->fetch()){
											echo "<li>$poll_title</li>";
												$cmd2 = $mysqli -> prepare($sql);
												$cmd2 -> bind_param("s", $id);
												$cmd2 ->execute() or die($mysqli -> error);
												$cmd2 -> store_result();
												$cmd2 -> bind_result($poll_result);											
									?>
								</ul>
							
							<ul>
								<?
                                                                        
									//start while
									 while($cmd2->fetch()){
												echo "<li> $poll_result</li>";
											}	//end while	
									}//end while									                                                                        
								?>
							</ul>
							</div>
							<ul>
							<?
								//get poll_reuslt total 
								$sql_total = "SELECT COUNT(`id`) FROM `poll`"; 
								$cmd3 = $mysqli ->prepare($sql_total);
								$cmd3 ->execute() or die($mysqli->error);
								$cmd3 -> store_result();
								$cmd3 -> bind_result($poll_result_total);
								while($cmd3->fetch()){
							?>
								<li>Tổng cộng có : <?php echo "$poll_result_total";}?> lượt bình chọn</li>
							</ul>
							</div>
						</div>
					
				</div>
			</div>
			<div class="bt_right"><div class="bt_left"></div></div>
			</div>
	</div>
	<div class="clear"></div>
</div>